import Vue from 'vue'
import App from './App.vue'
import router from './router'

import * as echarts from "echarts";
Vue.prototype.$echarts = echarts;

Vue.config.productionTip = false

//引入全局的CSS
import  './assets/css/global.css'

import ElementUI from 'element-ui'
Vue.use(ElementUI)
import 'element-ui/lib/theme-chalk/index.css';

//引入生成Excel表格的所需的依赖
import FileSaver from 'file-saver'
import XLSX from 'xlsx'

//全局函数用户生成表格
Vue.prototype.ToExcel = function (dom,title) {
  const wb = XLSX.utils.table_to_book(document.querySelector(dom))
  const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' })
  const blob = new Blob([wbout], { type: 'application/octet-stream' })
  FileSaver.saveAs(blob, `${title}.xlsx`)
}

import MyUrl from './plugins/url'
import axios from 'axios'
//设置默认 路径
axios.defaults.baseURL = MyUrl.serverUrl
Vue.prototype.$Myurl = MyUrl;


//设置axios的拦截器


//回应拦截器

Vue.prototype.$axios = axios;



//引入 qs
import qs from 'qs'
Vue.prototype.$qs = qs


new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
